<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>

    // var m = new Map()

    // m.set(100, 100).set('hello', 'world').set(123, '123').set('obj', { objkey: 'objval', objkey1: 'objval1' })


    // console.log(m)
    // console.log(m.has("hello"))


    var arr = [1, 2, 3]
    var o = { a: 1, b: 2 }
    var oo = { a: 'a1', b: 'b1' }
    var arr = [["hello", "world"], [100, 200], [true, false], [null, undefined], [arr, arr], [o, oo]]
    var m = new Map()

    /*-----------------------------------*/
    var m = new Map()
    arr.forEach(function (item) {
        var key = item[0]
        var val = item[1]
        m.set(key, val)
    })
    // console.log(m)
    /*---------------------------------------------*/
    var m = new Map(arr)
    console.log(m)












    // // 链式操作: (本质:方法返回的是同一类型的数据 原本的/新的)
    // var arr = [1, 2, 3]
    // var result = arr.reverse()
    // console.log(arr)
    // console.log(result)




    // var arr = [1, 2, 3]
    // var result = arr.concat(4, 5, 6).concat(7, 8, 9)
    // console.log(arr)
    // console.log(result)



</script>

</html>